import request from '@/utils/request'

export function queryResource(token) {
  return request({
    url: '/resource',
    method: 'get',
    params: {token}
  })
}

export function queryResourceByPage(data) {
  return request({
    url: '/admin/resource/getList',
    method: 'post',
    data: data
  })
}

export function detail(id) {
  return request({
    url: '/admin/resource/detail',
    method: 'get',
    params: {id}
  })
}

export function add(data) {
  return request({
    url: '/admin/resource/add',
    method: 'post',
    data: data
  })
}

export function update(data) {
  return request({
    url: '/admin/resource/update',
    method: 'post',
    data: data
  })
}

export function changeState(id) {
  return request({
    url: '/admin/resource/changeState',
    method: 'post',
    params: {id}
  })
}
